# encoding: utf-8
import os
from shutil import move, make_archive

# files to archive
# Директория для архивирования (папка)
archive = u'D:/Multimedia/Фотки/Canon'.encode("cp1251")
# worked directory
# рабочая директория (откуда берутся фотки для запаковки)
work_directory = u'D:/Multimedia/Фотки/Canon'.encode("cp1251")
video_directory = u'D:/Multimedia/Video'.encode("cp1251")


#if not os.path.exists(archive):

    #os.mkdir(archive)

list_directories = os.listdir(work_directory)
#print list_directories


for PhotoDir in list_directories:   
    
    for files in os.listdir(work_directory + "/" + PhotoDir):
        if os.path.splitext(files)[1] == ".MOV":
            print "File to moving: " + files
            print files
            move(work_directory + "/" + PhotoDir + "/" + files, video_directory)

    SevenZipCommand = "7z a -ttar " + PhotoDir + ".tar " + work_directory + "/" + PhotoDir + "/"
    #print SevenZipCommand
    make_archive(work_directory+ "/" + PhotoDir, 'tar', work_directory + "/" + PhotoDir)    
    #os.system(SevenZipCommand)
       